package com.test.pattern.adapter.object_adapter;

/**
 * @ClassName: SDAdapterTF
 * @description:  对象适配器,我理解就是在适配器中聚合要适配的方法
 * @author: Mr du
 * @create: 2024-02-20 22:04
 */
public class SDAdapterTF implements SDCard {

    private TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter read tf card ");
        return tfCard.readTF();
    }

    @Override
    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(msg);
    }
}
